package com.zm.scsimple.ribbon;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author zoum
 * @create 2019/2/26 16:41
 */
@SpringBootApplication
@RibbonClient(name="ribbon-service", configuration = SayHiConfiguration.class)
public class RibbonApp {

    public static void main(String[] args){
        SpringApplication.run(RibbonApp.class, args);
    }

    @LoadBalanced
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
